package com.east.spark.parttern.builder;

import java.util.List;

public class Client {

	public static void main(String[] args) {

		Builder builder = new Builder();
		builder.produceEmailSender(5);
		builder.produceSmsSender(5);
		/**
		 * 遍历list中的元素
		 */
		List<Sender> list = builder.getList();
		for (int i = 0; i < list.size(); i++) {
			Sender sender = list.get(i);
			System.out.println(sender);
			sender.send();
		}
	}
}
